package pt.uma.gap.ast;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jdt.core.dom.Assignment;
import org.eclipse.jdt.core.dom.MethodInvocation;

public class AssignmentInfo {
	
	private FlowType assignmentType  = FlowType.UNDEFINED;

	private Assignment assignment;
	private List<MethodInvocation> methodInvocationList;
	
	public AssignmentInfo(Assignment assignment) {
		setAssignment(assignment);
	}

	public Assignment getAssignment() {
		return assignment;
	}

	public void setAssignment(Assignment assignment) {
		this.assignment = assignment;
		
	}

	public void setAssignmentType(FlowType assignmentType) {
		this.assignmentType = assignmentType;
	}

	public FlowType getAssignmentType() {
		return assignmentType;
	}

	public void addMethodInvocation(MethodInvocation methodInvocation) {
		if(this.methodInvocationList == null){
			this.methodInvocationList = new ArrayList<MethodInvocation>(1);
		}
		this.methodInvocationList.add(methodInvocation);
	}

	public List<MethodInvocation> getMethodInvocationList() {
		return methodInvocationList;
	}
	
	public int getMethodInvocationListSize(){
		if(methodInvocationList == null){
			return 0;
		}else{
			return methodInvocationList.size();
		}
	}
	
	
}
